
var common = require("../../public.js");
const config = require('../../config.js')
Page({
    data: {
        active: 0,
        show: false,   
        objs:"",
        cheked:false,
        shows:false,
    },
        // 打开弹窗
        onClickShow(e) {
          this.setData({
             objs:e.currentTarget.dataset.item
          },()=>{
            this.setData({ show: true });
          })
        },
      
        onClickHide() {
          var that = this
          this.setData({
             show: false 
            },()=>{
              // 跳转预约界面
              wx.navigateTo({
                url: '/pages/goYuyue/yuYue/index?item=' + JSON.stringify(that.data.objs),
              })
            });
        },
        noop() {},
       // 标签切换
       onChange(event) {
        wx.showToast({
          title: `切换到标签 ${event.detail.name}`,
          icon: 'none',
        });
      },

      // 会员卡详情
      cardsList(){
        var that = this
        common.get('/userAnnualCard/getCardProductList', { cardId:that.data.id}, res => {
          if (res.status === 200) {
            that.setData({
              nianList:res.data,
              token:that.data.token
           },()=>{
            //  that.selectComponent('#vanTabs').resize()
           })
          } else {
            common.showRequestErrMsg(res)
          }
      })
        
  },
    onLoad: function (options) {
      var that = this
      console.log(options)
      that.setData({
        id:options.id
      },()=>{
        this.cardsList()
      })
    },
    onReady:function(){
      setTimeout(() => {
        this.setData({
          shows:true
        })
       }, 300);
    }, 
})